public class Date {
    public int year;
    public int month;
    public int date;
    public void setDate(int year, int month, int date){
        this.year = year;
        this.month = month;
        this.date = date;
    }
    public void print(){
        System.out.println(year+"-"+month+"-"+date);
    }

    public static void main(String[] args) {
        Date date1 = new Date();
        date1.year = 2022;
        date1.month = 12;
        date1.date = 3;

        date1.setDate(2022,12,2);
        date1.print();
    }
}
